﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/Site.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="danh-muc-khoan.aspx.cs" Inherits="VanTaiTMS.Page.danh_muc_khoan" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!---Check-all----->
<script type="text/javascript">
    function checkAll() {
        $('.bordered tbody tr').each(function () {
            if ($('input#chkAll').is(":checked")) {
                $('input#chkList').attr({ 'checked': 'checked' });
                $('input#chkList').parent().parent().css({ 'background': 'rgb(208, 233, 198)' });
            } else {
                $('input#chkList').attr({ 'checked': false });
                $('input#chkList').parent().parent().css({ 'background': '' });
            }
        });
    }
</script>
<!-------End------->

<!------Popup------>
<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#cabin').dialog({
            autoOpen: false,
            modal: true,
            draggable: true,
            height: "auto",
            width: "auto",
            position: ['center', 50],
            resizable: false,
            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function () {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#thongbao').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "372px",
            position: ['center', 50],
            resizable: false,

            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function () {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        //setup new person dialog
        $('#thongbaoxoa').dialog({
            autoOpen: false,
            draggable: true,
            height: "auto",
            width: "372px",
            position: ['center', 50],
            resizable: false,

            create: function (event) { $(event.target).parent().css('position', 'fixed'); },
            open: function () {
                $(this).parent().appendTo("form");
            }
        });
    });
</script>
<!-------End------->

<!---AutoComplete-->
<script type="text/javascript">
    function pageLoad() {
        $(document).ready((function () {
            var availableTags1 = [<%= SuggestionList %>];

            $("#<%= txtSearch.ClientID %>").autocomplete({
                source: availableTags1
            });
        }));

        $(function () {
            $(".textboxngaynhap").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });

        $(function ($) {
            $(".textboxngaynhap").mask("99/99/9999"); //Kiem tra ngay nhap
            $("#phone").mask("(999) 999-9999"); //Kiem tra so dien thoai
            $("#tin").mask("99-9999999");
            $("#ssn").mask("999-99-9999");
        });

        //Check Row Hender Color
        $(document).ready(function () {
            $('.bordered tbody tr').click(function (event) {
                if (event.target.type !== 'checkbox') {
                    $(':checkbox', this).trigger('click');
                }
            });

            $("input[type='checkbox']").change(function (e) {
                if ($(this).is(":checked")) {
                    $(this).closest('tr').css("background", "rgb(208, 233, 198)");
                } else {
                    $(this).closest('tr').css("background", "");
                }
            });
        });
    }
</script>
<!-------End------->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upDatePanelAll" runat="server">
    <ContentTemplate>
        <div id="toolbar-1" class="yui3-toolbar">
            <asp:Panel id="panel1" runat="server" DefaultButton="cmdSerach">
            <div class="div-search_A">
                <asp:Button ID="cmdAddNew" CssClass="btn-add-new" runat="server" OnClick="cmdAddNew_Click" />
                <asp:Button ID="cmdEdit" CssClass="btn-add-edit" runat="server" OnClick="cmdEdit_Click" />
                <asp:Button ID="cmdDel" CssClass="btn-add-delete" OnClientClick="return confirmCheckIn(this);" runat="server" OnClick="cmdDel_Click" />
            </div>

            <div class="div-search-texbox">
                <asp:TextBox ID="txtSearch" placeholder="Nhập vào từ khoá tìm kiếm..." CssClass="textbox_child" runat="server"></asp:TextBox>
            </div>

            <div class="div-search">
                <asp:Button ID="cmdSerach" CssClass="btn-add-search" runat="server" OnClick="cmdSerach_Click" />
                <asp:Button ID="cmdRefesh" CssClass="btn-add-refesh" runat="server" OnClick="cmdRefesh_Click" />
            </div>
            </asp:Panel>
        <div class="clr"></div>
        </div>
        <%= StrAlert %>
        <!-----------Hiễn-Thị-Dữ-Liệu------------>
        <table class="bordered">
            <thead>
                <tr>
                    <th width="5%">STT</th>
                    <th width="5%">
                        <input type="checkbox" onclick=" checkAll('chkList'); " id="chkAll">
                    </th>
                    <th width="15%">Mã Cabin</th>
                    <th width="15%">Tên Cabin</th>
                    <th width="10%">Số xe</th>
                    <th width="10%">Độ dài</th>
                    <th width="10%">Chiều rộng</th>
                    <th width="10%">Chiều cao</th>
                    <th width="10%">Thể tích</th>
                </tr>
            </thead>

            <tbody>
                <asp:ListView ID="ListViewAll" runat="server" ItemPlaceholderID="lstViewAll" DataKeyNames="Cabin_Id" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td style="text-align: center">
                                <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("Row_ID") %>'></asp:Label>
                            </td>

                            <td style="text-align: center">
                                <asp:CheckBox ID="chkList" ClientIDMode="Static" runat="server" />
                            </td>

                            <td style="text-align: center">
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("Cabin_Alias") %>'></asp:Label>
                                <input type="hidden" id="hidden1" value='<%# Eval("Cabin_Id") %>' runat="server" name="hiddenId" />
                            </td>

                            <td style="text-align: center">
                                <asp:Label ID="lbDVTIntoMaVatTuCNBD" runat="server" Text='<%# Eval("Cabin_Name") %>'></asp:Label>
                                <input type="hidden" id="hiddenId" value='<%# Eval("Cabin_Id") %>' runat="server" name="hiddenId" />
                            </td>

                            <td style="text-align: center">
                                <asp:LinkButton ID="LinkButton1" CommandName="Accept" runat="server"><%# Eval("Vehicle_Number") %></asp:LinkButton>
                            </td>

                            <td style="text-align: center">
                                <asp:LinkButton ID="linkTenDanToc" CommandName="Accept" runat="server"><%# Eval("Cabin_Length") %></asp:LinkButton>
                            </td>

                            <td style="text-align: center">
                                <asp:LinkButton ID="linkTenDanTocE" CommandName="Accept" runat="server"><%# Eval("Cabin_Width") %></asp:LinkButton>
                            </td>

                            <td style="text-align: center">
                                <asp:LinkButton ID="linkTenDanTocC" CommandName="Accept" runat="server"><%# Eval("Cabin_Height") %></asp:LinkButton>
                            </td>

                            <td style="text-align: center">
                                <asp:Label ID="lb_Total" runat="server" Text='<%# Eval("Cabin_Total") %>'></asp:Label>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <asp:PlaceHolder runat="server" ID="lstViewAll"></asp:PlaceHolder>
                    </LayoutTemplate>
                </asp:ListView>
            </tbody>
        </table>
        <!--------------Kêt-thúc----------------->

        <!-------------Phân-trang---------------->
        <table class="bordered">
            <thead>
                <tr>
                    <th class="pager">
                        <asp:DataPager ID="DataPagerListAll" runat="server"
                            OnPreRender="DataPagerListAll_PreRender" PagedControlID="ListViewAll">
                            <Fields>
                                <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;"
                                    ShowFirstPageButton="True" ShowNextPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;"
                                    ShowLastPageButton="True" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </th>
                </tr>
            </thead>
        </table>
        <!--------------Kêt-thúc----------------->
    </ContentTemplate>
</asp:UpdatePanel>

<!-------------Edit-Dữ-Liệu-------------->
<div id="cabin" title="Cập nhật Cabin">
    <asp:UpdatePanel ID="upNewUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div class="toolbar-ui-all-big">
                <asp:ImageButton CssClass="button-all" ID="imgSave" ImageAlign="Middle"
                    ImageUrl="~/Icon/save.png" runat="server"
                    OnClick="imgSave_Click" />

                <asp:ImageButton CssClass="button-all" ID="imgrefesh" ImageAlign="Middle"
                    ImageUrl="~/Icon/refesh-ui.png" ToolTip="Làm tươi" runat="server"
                    OnClick="imgrefesh_Click" />
            </div>
            <div class="clr"></div>
            <div class="ui-main">
                <div style="display: none">
                    <asp:Label ID="lbID" runat="server"></asp:Label>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">Mã Cabin <span style="color:Red">(*)</span></label>
                    <asp:TextBox ID="txtMaCabin" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">Tên Cabin <span style="color:Red">(*)</span></label>
                    <asp:TextBox ID="txtTenCabin" CssClass="textbox" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">Chọn số xe <span style="color:Red">(*)</span></label>
                    <asp:DropDownList ID="drChooseCarNumber" CssClass="select-drop-child-a" runat="server" AutoPostBack="true" AppendDataBoundItems="true">
                        <asp:ListItem Value="-1">--Chọn số xe--</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="clr"></div>
                <div class="ui-box-text-box">
                    <label class="label">Chiều dài </label>
                    <asp:TextBox ID="txtChieuDai" CssClass="textbox" onkeyup="this.value=FormatNumber(this.value);" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">Chiều rộng </label>
                    <asp:TextBox ID="txtChieuRong" CssClass="textbox" onkeyup="this.value=FormatNumber(this.value);" runat="server"></asp:TextBox>
                </div>

                <div class="ui-box-text-box">
                    <label class="label">Chiều cao</label>
                    <asp:TextBox ID="txtChieuCao" CssClass="textbox" onkeyup="this.value=FormatNumber(this.value);" runat="server"></asp:TextBox>
                </div>
                <div class="clr"></div>
            </div>
            <div class="clr"></div>
            <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upNewUpdatePanel">
                <ProgressTemplate>
                    <img alt='loadding' class="loading" src="../images/loading-fb.gif" /><br />
                    <div class="loading-label-right">
                        Đang xử lý dữ liệu...
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="imgSave" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->

<!-------------Thông-Bao-Xoá------------->
<div id="thongbaoxoa" title="Thông Báo">
    <asp:UpdatePanel ID="upDatePanelThongBaoXoa" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <div style="display: none">
                <asp:Label ID="lbIDXoa" runat="server" Text=""></asp:Label>
            </div>
            <p>
                <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
                <asp:Label ID="lbThongBaoXoa" CssClass="error-msg" runat="server" Text=""></asp:Label>
            </p>
            <hr />
            <div class="toolbar-ui-footer">
                <asp:Button ID="cmdAgree" CssClass="btn btn-info" Height="29px" runat="server"
                    Text="Đồng ý" OnClick="cmdAgree_Click" />

                <asp:Button ID="cmdClose" CssClass="btn btn-info" Height="29px" runat="server"
                    Text="Bỏ qua" OnClick="cmdClose_Click" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->

<!-------------Thông-Bao----------------->
<div id="thongbao" title="Thông Báo">
    <asp:UpdatePanel ID="updatePanelThongBao" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
        <ContentTemplate>
            <p>
                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                <asp:Label ID="lbThongBaoLoi" CssClass="error-msg" runat="server" Text=""></asp:Label>
            </p>
            <hr />
            <div class="toolbar-ui-footer">
                <asp:Button ID="cmdCloseThongBao" CssClass="btn btn-info" Height="29px" runat="server"
                    Text="Đóng lại" OnClick="cmdCloseThongBao_Click" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<!--------------Kêt-thúc----------------->
</asp:Content>